<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>测试Event类型</title>
    <script src="./dist/jevent.js"></script>
</head>
<body>
    <script>
        let customEvent = new JEvent("customEvent")
        let customError = new JErrorEvent("customError")
        const et = new JEventTarget()
        et.addEventListener("customEvent",()=>{
            console.log(customEvent.toString())
        })

        et.addEventListener("customEvent",()=>{
            console.log('仅仅一次' + customEvent.toString())
        }, {once: true})

        et.addEventListener("JError",()=>{
            console.log(customError.toString())
        })

        et.dispatchEvent(customEvent)
        et.dispatchEvent(customError)
        et.dispatchEvent(customEvent)
        et.dispatchEvent(customError)
    </script>
</body>
</html>